package com.team.cloudsharing.dao.backupfile;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.team.cloudsharing.dao.file.FileDO;

@Entity
@Table(name = "back_up_file")
public class BackUpFileDO implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "back_up_file_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long backUpFileId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "file_id", nullable = false)
	private FileDO fileDO;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modified_date_bkfile", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
	private Date modifiedDateBKFile = new Date();

	@Column(name = "modifed_user_id_bkfile", nullable = false)
	private Long modifiedUserIdBKFile;

	public BackUpFileDO() {
	}
	
	public BackUpFileDO(FileDO fileDO, Date modifiedDateBKFile,
			Long modifiedUserIdBKFile) {
		super();
		this.fileDO = fileDO;
		this.modifiedDateBKFile = modifiedDateBKFile;
		this.modifiedUserIdBKFile = modifiedUserIdBKFile;
	}

	public Long getBackUpFileId() {
		return backUpFileId;
	}

	public void setBackUpFileId(Long backUpFileId) {
		this.backUpFileId = backUpFileId;
	}

	public FileDO getFileDO() {
		return fileDO;
	}

	public void setFileDO(FileDO fileDO) {
		this.fileDO = fileDO;
	}

	public Date getModifiedDateBKFile() {
		return modifiedDateBKFile;
	}

	public void setModifiedDateBKFile(Date modifiedDateBKFile) {
		this.modifiedDateBKFile = modifiedDateBKFile;
	}

	public Long getModifiedUserIdBKFile() {
		return modifiedUserIdBKFile;
	}

	public void setModifiedUserIdBKFile(Long modifiedUserIdBKFile) {
		this.modifiedUserIdBKFile = modifiedUserIdBKFile;
	}

}
